Skip to content

[confcom] Fix bugs in containers from_vn2 command#9625

Merged
necusjz merged 9 commits intoAzure:mainfrom
andpiccione:apiccione/fix-bugs-confcom-containers-from-vn2-command
Mar 2, 2026
Merged

[confcom] Fix bugs in containers from_vn2 command#9625
necusjz merged 9 commits intoAzure:mainfrom
andpiccione:apiccione/fix-bugs-confcom-containers-from-vn2-command

Conversation

@andpiccione
Copy link
Copy Markdown
Member

Fix various bugs found when testing the new containers from_vn2 command with policy fragment generation. See CHANGELOG for details.


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az confcom

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Feb 22, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 22, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes multiple bugs in the containers from_vn2 command that were discovered during testing with policy fragment generation. The fixes improve compatibility with ORAS CLI >= 1.3.0, correct handling of Kubernetes Deployment/StatefulSet resources, and prevent incorrect policy generation for containers without explicit commands or with non-exec probes.

Changes:

  • Fixed ORAS fragment discovery to support both old ("manifests") and new ("referrers") API response formats in ORAS CLI >= 1.3.0
  • Fixed Deployment/StatefulSet volume mount and securityContext resolution to correctly access pod template specs
  • Fixed command array handling to preserve image ENTRYPOINT/CMD when no command/args are specified in Kubernetes YAML
  • Fixed exec_processes generation to exclude non-exec probes (httpGet/tcpSocket)

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/confcom/setup.py Version bump from 1.7.1 to 1.7.2 for bug fix release
src/confcom/HISTORY.rst Added changelog entries documenting all four bug fixes
src/confcom/azext_confcom/oras_proxy.py Added backward compatibility for ORAS >= 1.3.0 by checking both "referrers" and "manifests" keys
src/confcom/azext_confcom/lib/images.py Added filtering to prevent errors from dmverity-vhd output lines without "hash: "
src/confcom/azext_confcom/command/containers_from_vn2.py Added _get_pod_spec helper and fixed volume, securityContext, command, and exec_processes handling for templated Kubernetes resources
src/confcom/samples/vn2/*/containers.inc.rego Removed empty "command" arrays from 10 sample outputs to match fixed behavior

@andpiccione andpiccione requested a review from DomAyre February 23, 2026 21:29
@andpiccione andpiccione marked this pull request as ready for review February 25, 2026 16:15
@andpiccione
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9625 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 26, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@andpiccione
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9625 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 26, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@andpiccione
Copy link
Copy Markdown
Member Author

Looks like there are 5 CI tests failing due to Docker Hub rate limiting:

docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit as '1eshostedagent'

Since this is unrelated to these changes, the PR should be ready to get merged.

@andpiccione
Copy link
Copy Markdown
Member Author

@yonzhan Could you please re-run tests? They might eventually pass if they don't hit the Docker Hub rate limit.

@andpiccione
Copy link
Copy Markdown
Member Author

@necusjz Could you please review and merge this PR?

@andpiccione
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9625 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 27, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@andpiccione
Copy link
Copy Markdown
Member Author

The tests are now failing for unrelated errors to other integration tests:

vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/elastic-san/azext_elastic_san/tests/latest/recordings/test_elastic_san_volume_group_and_volume_scenarios.yaml') in your current record mode ('once').

@necusjz @yonzhan Can we please go ahead and merge the PR?

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Mar 2, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@andpiccione
Copy link
Copy Markdown
Member Author

@necusjz The PR has passed all the checks. Could you please approve and merge it? Thanks!

@necusjz necusjz merged commit d8a4d3d into Azure:main Mar 2, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented Mar 2, 2026

[Release] Update index.json for extension [ confcom ] : https://dev.azure.com/msazure/One/_build/results?buildId=155068399&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants